<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
          xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head  th:replace="top::html">
  <title>添加用户</title>
</head>

<body class="fixed hold-transition skin-blue">
<div class="wrapper">

  <!-- Main Header -->

     <div th:replace="tophtml::html" ></div>
  <!-- Left side column. contains the logo and sidebar -->
  <div th:replace="left::html" ></div>
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        添加用户
        <small></small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li>
        <li class="active">Here</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content container-fluid">

      <!--------------------------
        | Your Page Content Here |
        -------------------------->
        <form th:action="@{/user/addUser}" method="post" th:object="${user}">
        <div class="form-group">
                  <label>登录名</label>
                  <input type="text" class="form-control" placeholder="Enter ..." name="userName" th:value="${user.userName}">
                  <p style="color: red;" th:if="${#fields.hasErrors('userName')}" th:errors="*{userName}">Error</p>
         </div>
         
        <div class="form-group">
                  <label>密码</label>
                  <input type="password" class="form-control" placeholder="Enter ..."  name="userPwd">
                  <p style="color: red;" th:if="${#fields.hasErrors('userPwd')}" th:errors="*{userPwd}">Error</p>
         </div> 
        <div class="form-group">
                  <label>姓名</label>
                  <input type="text" class="form-control" placeholder="Enter ..."  name="fullName" th:value="${user.fullName}">
                  <p style="color: red;" th:if="${#fields.hasErrors('fullName')}" th:errors="*{fullName}">Error</p>
         </div>
        <div class="form-group">
                  <label>岗位</label>
                  <input type="text" class="form-control" placeholder="Enter ..."  name="post" th:value="${user.post}">
                  <p style="color: red;" th:if="${#fields.hasErrors('post')}" th:errors="*{post}">Error</p>
         </div>
         
         <div class="form-group">
          <label>角色</label>
                  <div class="checkbox" th:each="collect,iterStat : ${roles}">
                    <label>
                      <input type="checkbox" name="role" th:value="${collect.pid}" th:text="${collect.name }" >
                      
                    </label>
                  
                  </div>
				  <p style="color: red;" th:if="${#fields.hasErrors('role')}" th:errors="*{role}">Error</p>
        </div> 
         
         
         
		<div class="form-group">
		                <label>入职时间:</label>
		
		                <div class="input-group date">
		                  <div class="input-group-addon">
		                    <i class="fa fa-calendar"></i>
		                  </div>
		                  <input type="text" class="form-control pull-right" id="datepicker" name="entryTime" th:value="${user.entryTime}">
		                  <p style="color: red;" th:if="${#fields.hasErrors('entryTime')}" th:errors="*{entryTime}">Error</p>
		                </div>
		                <!-- /.input group -->
		</div>              
        <div class="form-group">
                  <label>联系电话</label>
                  <input type="text" class="form-control" placeholder="Enter ..." name="tell" th:value="${user.tell}">
                    <p style="color: red;" th:if="${#fields.hasErrors('tell')}" th:errors="*{tell}">Error</p>
         </div>        



<div class="box-footer">
                <button type="submit" class="btn btn-primary">添加</button>
</div>

</form>
    </section>
    <!-- /.content -->
  </div>
 <!-- /.content-wrapper -->

  <!-- Main Footer -->

  <div th:replace="footer::html" ></div>

  <div class="control-sidebar-bg"></div>
</div>

<div th:replace="bottom::html" ></div>
</body>
</html>